export default {
  namespaced: true,
  state: {
    token: localStorage.getItem('token') || '',
    userInfo: localStorage.getItem('userInfo')
      ? JSON.parse(localStorage.getItem('userInfo'))
      : {},
    role: localStorage.getItem('token') || ''
  },
  mutations: {
    LOGIN_USER (state, { token, userInfo, role }) {
      state.token = token
      state.userInfo = userInfo
      state.role = role
    }
  }
}
